package com.ruoyi.keep.domain;

import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.score.domain.Goods;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 订单对象 order
 * 
 * @author wangziyang
 * @date 2024-08-13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("`order`")
public class Order
{

    /** 主键id */
    @TableId
    private Long id;

    /** 下单时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "下单时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date orderPlaceTime;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date orderUpdateTime;

    /** 用户id */
    @Excel(name = "用户id")
    private Long userId;

    /** 订单金额 */
    @Excel(name = "订单金额")
    private Double orderPrice;

    /** 支付方式（0非次数卡、1次数卡） */
    @Excel(name = "支付方式", readConverterExp = "0=非次数卡、1次数卡")
    private Long orderPayment;

    /** 订单类型（0是团课预约、1是私课，2是积分兑换） */
    @Excel(name = "订单类型", readConverterExp = "0=是团课预约、1是私课，2是积分兑换")
    private Long orderType;

    /** 订单状态（0是待支付、1是已支付、2已完成、3退款中、4已退款） */
    @Excel(name = "订单状态", readConverterExp = "0=是待支付、1是已支付、2已完成、3退款中、4已退款")
    private Long orderStatus;

    /** 收获地址id */
    @Excel(name = "收获地址id")
    private Long addressId;

    /** 逻辑删除字段 */
    @TableLogic
    private Long del;

    /*订单详情字段*/
    @TableField(exist = false)
    private long orderDetailId;

    /*订单搜索名称*/
    @TableField(exist = false)
    private String orderGoodsName;

    /*团课实体类*/
    @TableField(exist = false)
    private TeamClass teamClass;

    /*私教实体类*/
    @TableField(exist = false)
    private SelfishCourse selfishCourse;

    /*积分商品表*/
    @TableField(exist = false)
    private Goods goods;


    /*订单收货表*/
    @TableField(exist = false)
    private DeliveryAddress deliveryAddress;

    /*用户名称*/
    @TableField(exist = false)
    private String userName;

    public Order(Long id, Date orderPlaceTime, Date orderUpdateTime, Long userId, Double orderPrice, Long orderPayment, Long orderType, Long orderStatus, Long addressId) {
        this.id = id;
        this.orderPlaceTime = orderPlaceTime;
        this.orderUpdateTime = orderUpdateTime;
        this.userId = userId;
        this.orderPrice = orderPrice;
        this.orderPayment = orderPayment;
        this.orderType = orderType;
        this.orderStatus = orderStatus;
        this.addressId = addressId;
    }

    /*用户*/
    @TableField(exist = false)
    private CommonUsers commonUsers;
    /*订单详情*/
/*订单商品中间表*/
    @TableField(exist = false)
    private List<OrderDetail> orderDetail;

}
